package com.ruicar.afs.cloud.seats.job;

import com.ruicar.afs.cloud.common.job.core.biz.model.ReturnT;
import com.ruicar.afs.cloud.common.job.core.handler.annotation.AfsJob;
import com.ruicar.afs.cloud.common.job.core.handler.annotation.AfsJobHandler;
import com.ruicar.afs.cloud.seats.service.UserCollocationService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
* @Description: 工作日历上离岗定时任务
* @Author: TIANKAI
* @Date: 2020/8/24
*/
@AfsJob
@AllArgsConstructor
@Slf4j
@Component
public class ShopCalendarJob {
    private UserCollocationService service;

    @AfsJobHandler(value = "calendarExecute")
    public ReturnT<String> calendarExecute(String params) {
        try {
            service.calendarExecute();
            log.info("定时任务【工作日历上离岗】执行成功");
            return ReturnT.SUCCESS;
        }catch (Exception e){
            log.error("定时任务【工作日历上离岗】执行失败",e);
            return ReturnT.FAIL;
        }
    }
}
